
package com.example.administrator.printoutindemo.mvp.ui.fragment;


import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;

import com.example.administrator.printoutindemo.R;


/**
 * Created by mxn on 2016/12/13.
 * MenuListFragment
 */

public class MenuListFragment extends Fragment implements View.OnClickListener {

    private FlowingDrawerInterface mFlowingDrawerInterface;

    public interface FlowingDrawerInterface {

        void flowingDrawerClose();

        void search();

    }

    public MenuListFragment() {

    }

    @SuppressLint("ValidFragment")
    public MenuListFragment(FlowingDrawerInterface flowingDrawerInterface) {
        this.mFlowingDrawerInterface = flowingDrawerInterface;
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_menu_ru_ku, container, false);

//        View view_head = view.findViewById(R.id.view_head);
        Button btn_qu_xiao = view.findViewById(R.id.btn_qu_xiao);
        Button btn_que_ding = view.findViewById(R.id.btn_que_ding);
        EditText et_ding_dan_hao = view.findViewById(R.id.et_ding_dan_hao);
//        view_head.setOnClickListener(this);
        btn_qu_xiao.setOnClickListener(this);
        btn_que_ding.setOnClickListener(this);

        return view;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
//            case R.id.view_head:
//                mFlowingDrawerInterface.flowingDrawerClose();
//                break;
            case R.id.btn_qu_xiao:
                mFlowingDrawerInterface.flowingDrawerClose();
                break;
            case R.id.btn_que_ding:
                mFlowingDrawerInterface.search();
                break;
        }
    }


}
